const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave:false,
  productionSourceMap:false,
  publicPath:'/ticket-h5/lowcode',
  devServer: {
    proxy: {
      '/api': {
        // target: 'http://192.168.20.25:8002/cms-service',
        target: 'http://10.0.254.67:8002',
        changeOrigin: true,
        pathRewrite: {
          // 重新路由  localhost:8888/api/login  => www.baidu.com/api/login
          '^/api': '' // 假设我们想把 localhost:8888/api/login 变成www.baidu.com/login 就需要这么做
        }
      },
    }
  },
  configureWebpack: config => {
    // 环境判断
    if (process.env.NODE_ENV === 'production') {
      // 为生产环境修改配置...
      config.optimization.minimizer[0].options.minimizer.options.compress = Object.assign(
        config.optimization.minimizer[0].options.minimizer.options.compress,
        {
          drop_console: true
        }
      );
    } else {
      // 为开发环境修改配置...
    }
  }
})
